livepach: Add .livepatch.hooks functions and test-case
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Fri, 16 Sep 2016 13:02:05 +0000 (09:02 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 23 Sep 2016 16:39:44 +0000 (12:39 -0400)
commite602d666608c6189fb6a9b3afb62d6c2ea7274df
tree29d217fae7ca84a0a33b0028956e93290ea01690
parentf202c23069e50404d256b5f460308c683f6220ed
livepach: Add .livepatch.hooks functions and test-case

Add hook functions which run during patch apply and patch revert.
Hook functions are used by livepatch payloads to manipulate data
structures during patching, etc.

One use case is the XSA91. As Martin mentions it:
"If we have shadow variables, we also need an unload hook to garbage
collect all the variables introduced by a hotpatch to prevent memory
leaks.  Potentially, we also want to pre-reserve memory for static or
existing dynamic objects in the load-hook instead of on the fly.

For testing and debugging, various applications are possible.

In general, the hooks provide flexibility when having to deal with
unforeseen cases, but their application should be rarely required (<
10%)."

Furthermore include a test-case for it.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
docs/misc/livepatch.markdown
xen/arch/x86/test/xen_hello_world.c
xen/common/livepatch.c
xen/include/xen/livepatch_payload.h [new file with mode: 0644]